Skip to content

feat(debugger): auto-sign sig args from secret keys#113

Open
atl4so wants to merge 1 commit intokaspanet:covpp-reset2from
atl4so:feat/cli-debugger-auto-sign-sig-args
Open

feat(debugger): auto-sign sig args from secret keys#113
atl4so wants to merge 1 commit intokaspanet:covpp-reset2from
atl4so:feat/cli-debugger-auto-sign-sig-args

Conversation

@atl4so
Copy link
Copy Markdown

@atl4so atl4so commented Apr 28, 2026

Summary

Adds optional 32-byte secret-key auto-signing for sig arguments in cli-debugger .test.json fixtures.

If a sig argument is supplied as 32 bytes, the debugger now materializes it into a real Kaspa Schnorr signature over the test transaction sighash with SIG_HASH_ALL. Existing fixtures that pass raw 65-byte signatures continue to work unchanged. Includes argument offset handling for covenant functions where synthesized prefix args (State prev_state, State[] next_states) shift user-callable parameter positions.

Motivation

Upstream Rust tests can exercise signature flows by calling the Kaspa signing libraries directly and embedding raw signature bytes. External tooling that drives cli-debugger through .test.json cannot do that without reimplementing transaction signing outside the debugger.

This gives JSON-driven tools, fuzzers, and audit generators a deterministic way to produce signed fixtures from synthetic keys while still executing the real script path in cli-debugger.

Testing

  • cargo test -p cli-debugger

Added an integration test covering:

  • valid 32-byte secret key -> materialized Schnorr signature passes checkSig
  • wrong 32-byte secret key -> materialized signature fails checkSig
  • covenant function with sig param after synthesized prefix args -> secret key offset correctly, materialized signature passes checkSig

@atl4so atl4so force-pushed the feat/cli-debugger-auto-sign-sig-args branch 2 times, most recently from 415fc36 to 5b2a7e3 Compare April 28, 2026 13:02
@atl4so atl4so force-pushed the feat/cli-debugger-auto-sign-sig-args branch from 5b2a7e3 to 287437c Compare April 28, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant